From cb50fe8f529a3219357df4927e848e7673b10be6 Mon Sep 17 00:00:00 2001 From: Keir Fraser Date: Fri, 8 Jan 2010 11:48:36 +0000 Subject: [PATCH] libxenlight: initialize domid to -1 in domain_create prevent call site that doesn't check return values to try to do operation on domain 0. instead they use domid -1, which is unlikely to exist. Signed-off-by: Vincent Hanquez --- tools/libxl/libxl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c index 46dcebf76a..c2dcbcc52d 100644 --- a/tools/libxl/libxl.c +++ b/tools/libxl/libxl.c @@ -99,7 +99,7 @@ int libxl_domain_make(struct libxl_ctx *ctx, libxl_domain_create_info *info, flags = info->hvm ? XEN_DOMCTL_CDF_hvm_guest : 0; flags |= info->hap ? XEN_DOMCTL_CDF_hap : 0; - *domid = 0; + *domid = -1; /* Ultimately, handle is an array of 16 uint8_t, same as uuid */ memcpy(handle, info->uuid, sizeof(xen_domain_handle_t)); -- 2.30.2